<template>
  <div>
    <el-card class="cardBox">
      <div class="title">
        <h1 class="">主井皮带参数</h1>
        <el-button @click="alarmBtn">报警总数：0</el-button>
      </div>
      <!-- 参数表格 -->
      <div style="border: 1px solid var(--el-border-color-light)">
        <el-row class="header-row">
          <el-col :span="8"></el-col>
          <el-col :span="8" class="title-col">
            <span>主井皮带参数</span>
          </el-col>
          <el-col :span="8" class="status-col">
            <div class="status-container">
              <div>
                <span>通讯故障</span>
                <i class="yuan yellow"></i>
              </div>
              <div>
                <span>无故障</span>
                <i class="yuan grey"></i>
              </div>
              <div>
                <span>运行</span>
                <i class="yuan green"></i>
              </div>
              <div>
                <span>报警</span>
                <i class="yuan red"></i>
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row class="threeTitle">
          <el-col :span="4">项目</el-col>
          <el-col :span="2">1</el-col>
          <el-col :span="2">2</el-col>
          <el-col :span="4">项目</el-col>
          <el-col :span="2">1</el-col>
          <el-col :span="2">2</el-col>
          <el-col :span="4">项目</el-col>
          <el-col :span="4">状态</el-col>
        </el-row>

        <!-- 第1-3列：数值型参数 -->
        <el-row>
          <el-col :span="4">电机运行电流（A）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotOpCurr_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotOpCurr_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">主电机故障反馈</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip1MainMotorFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip2MainMotorFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">华宁备妥</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainHNReadyReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机输出转矩</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotOutTorque_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotOutTorque_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">变频器故障反馈</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip1MainMotorFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip2MainMotorFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">华宁闭锁</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('HNLock_DI', operator.NO).value ? 'red' : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机输出转速</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotOutSpeed_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotOutSpeed_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">水泵开关故障反馈</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip1PumpSwitchFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip2PumpSwitchFault_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">制动器故障</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('BrakeFault_DI', operator.NO).value ? 'red' : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机运行功率（KW）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotOpPower_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotOpPower_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">风机开关故障反馈</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainFan1FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainFan2FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">张紧故障</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main(
                  'PTMainTensionFeedReleaseSts_DI',
                  operator.NO
                ).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机直流电压（V）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotDCVolt_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotDCVolt_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">循环水泵运行状态</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainPump1FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainPump2FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">本地急停</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('LocalEmergencyStop_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">冷却水流量</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1CoolWaterFlow_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2CoolWaterFlow_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">冷却风机运行状态</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainFan1FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainFan2FeedReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">本地停止</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('LocalStop_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">冷却水温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1CoolWaterTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2CoolWaterTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">电机投用状态</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip1MotInUseSts_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip2MotInUseSts_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">健康输出</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('HealthOutput_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">冷却水压力</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1CoolWaterPress_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2CoolWaterPress_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">一体机运行状态</el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip1IntegratedSts_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="2">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('Equip2IntegratedSts_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
          <el-col :span="4">华宁运行</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main_PT_Main('PTMainHNRUNReleaseSts_DI', operator.NO)
                  .value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">滚筒温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1DrumTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2DrumTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <!-- 模块温度移动到第4-6列 -->
          <el-col :span="4">模块一温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module1Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module1Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">制动器运行</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('BrakeRun_DI', operator.NO).value ? 'green' : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机前轴温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotFrontShaftTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotFrontShaftTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">模块二温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module2Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module2Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">张紧运行</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_Main('TensionRun_DI', operator.NO).value
                  ? 'green'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机后轴温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotRearShaftTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotRearShaftTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">模块三温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module3Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module3Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">配仓停主运闭锁</el-col>
          <el-col :span="4">
            <div
              class="indicator-light"
              :class="
                NamePD_104('BinStopMainLock_DI', operator.NO).value
                  ? 'red'
                  : 'grey'
              "
            ></div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机A相温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotPhaseATemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotPhaseATemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">模块四温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module4Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module4Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4"></el-col>
          <el-col :span="4"></el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机B相温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotPhaseBTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotPhaseBTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">模块五温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module5Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module5Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4"></el-col>
          <el-col :span="4"></el-col>
        </el-row>

        <el-row>
          <el-col :span="4">电机C相温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1MotPhaseCTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2MotPhaseCTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">模块六温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1Module6Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2Module6Temp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4"></el-col>
          <el-col :span="4"></el-col>
        </el-row>

        <el-row>
          <el-col :span="4">变频内腔温度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1InvTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2InvTemp_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4">变频内腔湿度（℃）</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip1InvHumidity_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="2">{{
            NamePD_Main("Equip2InvHumidity_AI", operator.NO, null, 2)
          }}</el-col>
          <el-col :span="4"></el-col>
          <el-col :span="4"></el-col>
        </el-row>

        <el-row>
          <el-col :span="4" class="huaning-title">华宁保护</el-col>
          <el-col :span="20">
            <div class="hn-container">
              <span
                >跑偏保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main_PT_Main(
                        'PTMainDeviationReleaseSts_DI',
                        operator.NO
                      ).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >堆煤保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main('HNProtCoalPile_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >烟雾保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main_PT_Main(
                        'PTMainSmokeReleaseSts_DI',
                        operator.NO
                      ).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >纵撕保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main('HNProtLongTear_DI', operator.NO).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >温度保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main_PT_Main(
                        'PTMainHNTempProtectReleaseSts_DI',
                        operator.NO
                      ).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >速度保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main_PT_Main(
                        'PTMainHNSpeedProtectReleaseSts_DI',
                        operator.NO
                      ).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span
                >张紧力下降保护<span class="hn-span"
                  ><div
                    class="indicator-light"
                    :class="
                      NamePD_Main_PT_Main(
                        'PTMainTensionDropProtectReleaseSts_DI',
                        operator.NO
                      ).value
                        ? 'red'
                        : 'grey'
                    "
                  ></div></span
              ></span>
              <span style="color: orange"
                >终端电压（V）：<span>{{
                  NamePD_Main("HNProtTermVolt_AI", operator.NO, null, 2)
                }}</span></span
              >
            </div>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="4" class="huaning-title">华宁沿线闭锁</el-col>
          <el-col :span="20">
            <div class="index-container">
              <div
                v-for="(item, index) in HUANINGBH"
                :key="index"
                class="index-circle"
                :class="
                  NamePD_Main_PT_Main(item, operator.NO).value ? 'red' : 'grey'
                "
              >
                {{ index + 1 }}
              </div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div style="display: flex; justify-content: end; margin-top: 20px">
        <el-button @click="faultResetBtn">故障复位</el-button>
        <el-button @click="sensorBtn">主井驱动机房参数</el-button>
      </div>

      <div style="margin-top: 50px">
        <span>摄像头</span>
        <span
          >皮带速度
          {{ NamePD_Main_GEN("BeltSpeed_AI", operator.NO, null, 2) }} m/s</span
        >
      </div>

      <div style="">
        <img
          src="@/assets/images/belt1.png"
          style="width: 100%; height: 250px"
        />
      </div>
    </el-card>

    <!-- 公司log -->
    <el-row>
      <div class="kx-log-box">
        <img
          class="kx-img"
          src="@/assets/images/kxauto.png"
          alt="描述图片的文字"
        />
        <span>开轩自动化</span>

        <span class="kx-hezuo">
          商务合作：18509234888（同微信） 技术支持：18691805301（同微信）
        </span>
      </div>
    </el-row>

    <!-- 弹窗 -->
    <form-dialog ref="formRef" />
    <sensorFormDialog ref="sensorRef" />
  </div>
</template>

<script setup lang="ts">
import { ref, computed } from "vue";
import EarthIcon from "@/assets/images/top.svg";
import { ElMessage, ElMessageBox } from "element-plus";
import formDialog from "./alarmForm.vue";
import sensorFormDialog from "./sensorForm.vue";
import { act, createWebSocket } from "@/utils/websocket"; //引入websocket

import { operator } from "@/utils/op_enums";
import {
  NamePD_Main,
  NamePD_Main_GEN,
  NamePD_Main_PT_Main,
  NamePD_104,
} from "@/utils/beltPositioningMethod.ts";

// svg 元素引用
const svgRef = ref<InstanceType<typeof EarthIcon>>();
const HUANINGBH = [
  "PTMainHNLock1Status_DI",
  "PTMainHNLock2Status_DI",
  "PTMainHNLock3Status_DI",
  "PTMainHNLock4Status_DI",
  "PTMainHNLock5Status_DI",
  "PTMainHNLock6Status_DI",
  "PTMainHNLock7Status_DI",
  "PTMainHNLock8Status_DI",
  "PTMainHNLock9Status_DI",
  "PTMainHNLock10Status_DI",
  "PTMainHNLock11Status_DI",
  "PTMainHNLock12Status_DI",
  "PTMainHNLock13Status_DI",
  "PTMainHNLock14Status_DI",
  "PTMainHNLock15Status_DI",
  "PTMainHNLock16Status_DI",
  "PTMainHNLock17Status_DI",
  "PTMainHNLock18Status_DI",
  "PTMainHNLock19Status_DI",
  "PTMainHNLock20Status_DI",
  "PTMainHNLock21Status_DI",
  "PTMainHNLock22Status_DI",
  "PTMainHNLock23Status_DI",
  "PTMainHNLock24Status_DI",
  "PTMainHNLock25Status_DI",
  "PTMainHNLock26Status_DI",
  "PTMainHNLock27Status_DI",
  "PTMainHNLock28Status_DI",
  "PTMainHNLock29Status_DI",
  "PTMainHNLock30Status_DI",
  "PTMainHNLock31Status_DI",
  "PTMainHNLock32Status_DI",
  "PTMainHNLock33Status_DI",
];
const formRef = ref();
const sensorRef = ref();

const alarmBtn = () => {
  formRef.value.openDialog();
};
const sensorBtn = () => {
  sensorRef.value.openDialog();
};
const faultResetBtn = () => {
  ElMessage.info("故障复位");
};

// const NamePD_Main = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.NamePD_Main.NamePD_Main[key], op, op_number, retain);
//   });

// const NamePD_Main_PT_Main = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(
//       act.NamePD_Main.PD_Main_PT_Main[key],
//       op,
//       op_number,
//       retain
//     );
//   });

// const NamePD_Main_GEN = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.NamePD_Main.PD_Main_GEN[key], op, op_number, retain);
//   });
</script>

<style lang="scss" scoped>
.cardBox {
  background-color: var(--el-bg-color);
  border-radius: 8px;
  box-shadow: var(--el-box-shadow-light);
  border: 1px solid var(--el-border-color-light);

  /* 左上方标题 */
  .title {
    border-bottom: 1px solid var(--el-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    h1 {
      color: var(--el-text-color-primary);
      font-size: 20px;
      margin: 0;
      font-weight: 500;
    }

    .el-button {
      background-color: var(--el-color-danger);
      color: var(--el-color-white);
      border: none;
      border-radius: 4px;
      padding: 8px 15px;
      font-weight: 500;

      &:hover {
        background-color: var(--el-color-danger-light-3);
      }
    }
  }

  /* 表格标题 + 四个指示灯 */
  .header-row {
    display: flex;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    font-weight: 500;
    color: var(--el-text-color-primary);
    padding: 10px;
    .el-col {
      height: 40px;
      display: flex;
      align-items: center;
      border: 1px solid transparent;
    }

    .title-col {
      justify-content: center;

      span {
        font-size: 18px;
      }
    }

    .status-col {
      justify-content: end;
      .status-container {
        display: flex;
        gap: 14px;

        div {
          background: var(--el-fill-color-blank);
          border: 1px solid var(--el-border-color-lighter);
          border-radius: 4px;
          padding: 4px 8px;
          display: flex;
          align-items: center;
          gap: 6px;
          font-size: 13px;

          span {
            padding: 0 4px;
          }

          .yuan {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
            @extend %status-colors;
          }
        }
      }
    }
  }

  /* 表格的标题 项目 + 状态值 */
  .threeTitle {
    .el-col {
      background-color: var(--el-fill-color) !important;
    }
  }

  /* 每一小格子的边框 背景色 */
  .el-col {
    border: 1px solid var(--el-border-color-lighter);
    text-align: center;
    padding: 6px 5px;
    font-size: 13px;
    color: var(--el-text-color-regular);

    &:first-child,
    &:nth-child(4),
    &:nth-child(7) {
      font-weight: 500;
      color: var(--el-text-color-primary);
      background-color: var(--el-fill-color-lighter);
    }
  }

  /* 子页面设备参数--指示灯 */
  .indicator-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--el-border-color);
    margin: 0 auto;
    @extend %status-colors;
  }

  /* 华宁沿线闭锁 */
  .huaning-title {
    display: flex;
    align-items: center;
    justify-content: center;
    // height: 100%;
    color: var(--el-text-color-primary);
    font-weight: 500;
  }

  .hn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    padding: 8px;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;

    span {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .hn-span {
      display: inline-flex;
      align-items: center;
    }
  }

  .index-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    justify-content: flex-start;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;
    min-height: 40px;
    align-items: center;
  }

  .index-circle {
    width: 26px;
    height: 26px;
    background-color: var(--el-border-color);
    border-radius: 50%;
    color: var(--el-text-color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    @extend %status-colors;
  }

  .terminal-voltage {
    color: var(--el-color-warning);
    margin-left: 20px;
    font-size: 13px;
  }

  // 定义基础颜色类（只定义一次）
  %status-colors {
    &.green {
      background-color: var(--el-color-success);
    }
    &.red {
      background-color: var(--el-color-danger);
    }
    &.yellow {
      background-color: var(--el-color-warning);
    }
    &.grey {
      background-color: var(--el-border-color-dark); // 比默认边框色更深的灰色
    }
  }
}
</style>
